# 定义集合
set1 = {1,2,3,4,5}
set2 = {1,3,5,7,9}
set3 = {0,2,4,6}
# 打印集合
print("打印set1：",set1)
print("打印set2：",set2)
print("打印set3：",set3)
# 修改集合
set3.add(8)
print("打印set3：",set3)
# 删除集合
set2.remove(9)
print("打印set2",set2)
# 计算集合元素个数
print("计算set1元素个数",len(set1))
# 判断某元素是否在集合内
if 1 in set3:
    print("1在set3")
else:
    print("1不在set3")
# 集合之间的关系
print("set1-set2:",(set1-set2))
print("set1&set2:",(set1&set2))
print("set1|set2:",(set1|set2))
print("set1^set2:",(set1^set2))